Dynamic resource allocation using projected future benefits

ABSTRACT

A method for server allocation in a Web server “farm” is based on limited information regarding future loads to achieve close to the greatest possible revenue based on the assumption that revenue is proportional to the utilization of servers and differentiated by customer class. The method of server allocation uses an approach of “discounting the future”. Specifically, when the policy faces the choice between a guaranteed benefit immediately and a potential benefit in the future, the decision is made by comparing the guaranteed benefit value with a discounted value of the potential future benefit. This discount factor is exponential in the number of time units that it would take a potential benefit to be materialized. The future benefits are discounted because by the time a benefit will be materialized, things might change and the algorithm might decide to make another choice for a potential (even greater) benefit.

CROSS REFERENCE TO RELATED APPLICATION

[0001] The subject matter this application is related to applicationSer. No. 09/______ filed concurrently herewith by Tracy Kimbrel et al.for “Dynamic Resource Allocation Using Known Future Benefits” (IBMDocket YOR9-2000-0824US1). The subject matter of application Ser. No.09/______ is incorporated herein by reference.

DESCRIPTION BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention generally relates to benefit task systemsand, more particularly, to a policy for allocating resources to maximizesome benefit. The invention may be applied to a variety of problems, andthe benefit may be either tangible (e.g., profit) or intangible (e.g.,customer satisfaction). In a specific example, the invention hasparticular application to server allocation in a Web site server “farm”given limited information regarding future loads to maximize profits forthe Web hosting service provider. In another specific example, theinvention can be applied to the allocation of telephone help in a way toimprove customer satisfaction. In yet another example, the invention maybe applied to distributed computing problems where the resources to beallocated are general purpose computers connected in a network and usedto solve computationally intensive problems.

[0004] 2. Background Description

[0005] Web content hosting is an important emerging market. Data centersand Web server “farms” are proliferating. The rationale for using suchcenters is that service providers can benefit from economies of scaleand sharing of resources among multiple customers. This benefit in turntranslates to lower cost of maintenance for the customers who purchasethese hosting services. Web content hosting services are structured inmany ways. One of the most prevailing ways is outsourcing: the customersdeliver their Web site content in response to HTTP (hyper text transferprotocol) requests. Service providers will use “farms” of commodityservers to achieve this goal.

[0006] One of the components in the payment for such a service is “payper served request”. Thus, one of the main objectives of the serviceprovider is to maximize the revenue from served requests while keepingthe tab on the amount of resources used. Ideally, the allocation to aWeb site should always suffice to serve its requests. However, due to alimited number of servers and the overhead incurred in changing theallocation of a server from one site to another, the system may becomeoverloaded, and requests may be left unserved. Under the assumption thatrequests are not queued, a request is lost if it is not served at thetime it is requested. The problem faced by the Web hosting serviceprovider is how to utilize the available servers in the most profitableway. What adds to the complexity of this problem is the fact that futureload of the sites is either unknown or known only for the very nearfuture. A Web content hosting service provider therefore needs aprocedure to dynamically allocate servers in a server “farm” to itscustomers' Web sites.

[0007] Similar considerations apply in the cases of computer servers andtelephone support centers. Telephone support centers typically arecomputer controlled telephone networks having a number of technicalsupport, order support and customer service support operators. Theseoperators are resources that must be allocated to customers who call in.Computer software is used to answer telephone calls and direct the callsto the appropriate pool of operators. In this application, the operatorsare the resources to be allocated. The wait time that a customerexperiences is inversely proportional to customer satisfaction and,therefore, it is important to be able to dynamically allocate resourcesin such a manner as to minimize customer wait time and increase customersatisfaction. In this application, customer benefit is the intangiblebenefit which is sought to be maximized.

[0008] In yet another example, the resources to be allocated are generalpurpose computers used to solve computationally intensive problems. Inthis environment, multiple computers can be used concurrently to solve aproblem faster than a single computer can solve it. The computers wouldbe connected in a network which may include the Internet. It has evenbeen proposed that personal computers connected to the Internet mightconstitute resources that could be employed in solving such problems. Itis anticipated that a market for such services will become standardizedto some extent, so that the computer cycles become a commodity(resource) available from multiple vendors. It would be an advantage todynamically allocate such resources.

SUMMARY OF THE INVENTION

[0009] It is therefore an object of the present invention to provide amethod for server allocation given limited information regarding futurerequirements.

[0010] It is another object of the invention to provide a method forserver allocation to achieve close to the greatest possible benefitbased on the assumption that benefit is proportional to the utilizationof resources.

[0011] According to the invention, the method of resource allocationuses an approach of “discounting the future”. Specifically, when thepolicy faces the choice between a guaranteed benefit immediately and apotential benefit in the future, the decision is made by comparing theguaranteed benefit value with a discounted value of the potential futurebenefit. This discount factor is exponential in the number of time unitsthat it would take a potential benefit to be materialized. The futurebenefits are discounted because by the time a benefit will bematerialized, things might change and the algorithm might decide to makeanother choice for a potential (even greater) benefit.

[0012] In the practice of the invention, the resource allocation problemis modeled mathematically. In the model, time is divided into intervals.For the Web server farm problem, the assumption is made that each site'sdemand is uniformly spread throughout each such interval. Serverallocations remain fixed for the duration of an interval. It is alsoassumed that servers are reallocated only at the beginning of aninterval, and that a reallocated server is unavailable for the length ofthe interval during which it is reallocated. This represents the time to“scrub” the old site (customer data) to which the server was allocated,to reboot the server and to load the new site to which the server hasbeen allocated. The length of the time interval is set to be equal tothe non-negligible amount of time required for a server to prepare toserve a new customer. In current technology, this time is in the orderof 5 or 10 minutes.

[0013] Each server has a rate of requests it can serve in a timeinterval. For simplicity, all rates are assumed to be identical. Due topractical concerns (mainly security constraints placed by customers),sharing of servers at the same time is not allowed. That is, customersshare servers only in the sense of using the same servers at differenttimes, but do not use the same servers at the same time. Thus, even incase of overload, some of the servers may be underutilized if they areallocated to sites with rates of requests lower than the servers' rate.

[0014] Each customer's demand is assumed to be associated with a benefitgained by the service provider in case a unit demand is satisfied. Givena fixed number of servers, the objective of the service provider is tofind a time-varying server allocation that would maximize benefit gainedby satisfying sites' demand. In a fully online implementation of theinvention, only the demand of the current interval is known at thebeginning of the interval. It is assumed that some amount of futuredemand is known to the service provider, and this is modeled bylookahead, which means that the demand of the sites is known for thenext predetermined number of time intervals (following the current timeinterval). Lookahead requires that some forecasting mechanism is used topredict future demands. In the online setting, an online allocationalgorithm is measured by its competitive ratio; that is, the maximumover all instances of the ratio of the benefit gained by the optimaloffline allocation to the benefit gained by the online allocation on thesame instance. Almost optimal algorithms (both deterministic andrandomized) are used for any positive lookahead. The quality of thesolution improves as the lookahead increases.

[0015] Interestingly, the model can be cast as a more general benefittask system. In this task system, we are given a set of states for eachtime, t, and a benefit function. The system can be at a single state ateach time, and the benefit for time t is a function of the system statesat times t−1 and t. The goal is to find a time varying sequence ofstates that maximizes the total benefit gained. That is, at each time t,we need to determine to which state should the system move (and thiswill be the state of the system at time t+1), and we gain the benefitthat is determined by the benefit function. Similar to the server farmmodel, in the fully online implementation of the invention, only thebenefit of the current step is known at the time the next move isdetermined, and in case of lookahead, L, the benefits of the next Lsteps (in addition to the current) are known.

[0016] It can be shown that benefit task systems capture also benefitmaximization variants of well studied problems, such as the k-serverproblem (see A. Borodin and R. El-Yaniv in On-Line Computation andCompetitive Analysis, Cambridge University Press, 1998) and metricaltask systems (see On-Line computation and Competitive Analysis, citedabove). Thus, our results hold for these variants as well, and show thatthe benefit variants of these problems may be more tractable than theircost minimization variants.

BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The foregoing and other objects, aspects and advantages will bebetter understood from the following detailed description of a preferredembodiment of the invention with reference to the drawings, in which:

[0018]FIG. 1 is a block diagram illustrating the architecture of a Webserver farm;

[0019]FIG. 2 is a flow diagram illustrating the process of allocatingservers using projected future benefits; and

[0020]FIG. 3 is a flow diagram illustrating the process of computing newallocations of servers.

DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT OF THE INVENTION

[0021] Although the invention is described in terms of a specificapplication to a Web server farm, this explanation is by way of exampleonly. It will be understood by those skilled in the art that theinvention may be applied to other applications. Among those applicationsare the customer telephone support problem and the allocation ofcomputers to computationally intensive problems already mentioned. TheWeb server farm problem will serve to provide a concrete application ofthe invention which can be applied to other resource allocationproblems.

[0022] Referring now to the drawings, and more particularly to FIG. 1,there is shown, in generalized form, the architecture of a Web serverfarm of the type managed and maintained by a Web hosting serviceprovider. The farm itself comprises a plurality of servers 10 ₁, 10 ₂,10 ₃, . . . , 10 _(n) connected to a server farm network 11. The serverfarm network 11 connects the servers via the Internet 12 to a pluralityof Web browsers 13 ₁, 13 ₂, . . ., 13 _(n). Customers of the Web hostingservice provider purchase hosting services, which include maintainingthe customers' Web sites so that the Web sites can be readily accessedby persons using the Web browsers. The Web hosting service providerseeks to maximize profits by allocation of resources, i.e., the servers.This is the function of the dynamic resource allocator 14 connected tothe server farm network.

[0023]FIG. 2 illustrates the general process implemented by the dynamicresource allocator 14. The process begins in function block 21 where thecurrent and forecasted per-customer demands and revenues are obtained.Next, current allocations of servers are obtained in function block 22,and then new allocations are computed in function block 23. The computednew allocations are compared with the current allocations in decisionblock 24 and, if they are different, then in function block 25,re-allocated servers are directed to serve their new customers beforethe process loops back to function block 21. If the new allocations arenot different from the current allocations, as determined in decisionblock 24, the process goes directly to function block 21 to begin theprocess anew.

[0024] The first function block 21, obtain current and forecastedper-customer demands and revenues, is outside the scope of the presentinvention. We assume some forecasting mechanism is used to determine theprojected demands and benefits. As will be explained in more detail, thepresent invention is the algorithm for deciding what the allocationsshould be based on a given forecast; i.e., function block 23, computenew allocations. Allocations are made based on the result of thiscomputation.

The Web Server Farm Problem

[0025] Suppose that we are given s Web sites that are to be served by kWeb servers. (For simplicity, we assume that all servers are identical.)Time is divided into units. It is assumed that the demand of a Web siteis uniform in each time unit. Each server has a “service rate” which isthe number of requests to a Web site each server can serve in a timeunit. Without loss of generality, we normalize the demands by theservice rate so that a server can serve one request per time unit anddemands of a site may be fractional. A Web server can be allocated to nomore than one site at each time unit and it takes a time unit to changethe allocation of a server.

[0026] A problem instance consists of the number of servers, k, thenumber of sites, s, a non-negative benefit matrix, b_(i,t), denoting thebenefit gained by serving a request of site i∈[1 . . . s] for time stept≧1, and a non-negative demand matrix, {d_(i,t)}, denoting the number ofrequests at site i for time step t. The goal is to find for each sitei∈[1 . . . s] a time varying allocation {a_(i,t)} of servers, so as tomaximize the total benefit, as follows. The allocation must satisfy thatfor each t,${{\sum\limits_{i = 1}^{s}a_{i,t}} \leq {{k.\quad {Only}}\quad a_{i,t}^{\prime}}} = {\min \left\{ {a_{i,{t - 1}},a_{i,t}} \right\}}$

[0027] of the servers allocated to site i for the time step t are“productive”, i.e., actually serve requests. We get that the totalbenefit of an allocation {a_(i,t)} is${\sum\limits_{t \geq 1}{\sum\limits_{i = 1}^{s}{{b_{i,t} \cdot \min}\left\{ {d_{i,t},a_{i,t}^{\prime}} \right\}}}} + {\sum\limits_{t \geq 1}{\sum\limits_{i = 1}^{s}{{b_{i,t} \cdot \min}{\left\{ {d_{i,t},a_{i,t},a_{i,{t - 1}}} \right\}.}}}}$

[0028] In the online solution of the problem according to the presentinvention, we need to compute the allocation {a_(i,t)} at time t giventhe demands so far, i.e., {d_(i,t′)} for all i and t′≦t. It is notdifficult to show that any fully online algorithm may performarbitrarily badly with respect to the offline optimal solution. This istrue because of the one time unit lag in a server's availability. Thus,we consider online algorithms with lookahead. In the online verison withlookahead L, at each time t we are additionally given the demands fortimes t+1, . . . , t+L, i.e., the entries d_(i,t′) for i ∈[1 . . . s]and t+1≦t′≦t+L, and we need to compute the allocation at time t, i.e.,a_(i,t) for i∈[1 . . . s].

The Benefit Task System Problem

[0029] The Web server farm problem is a special case of the generalizedtask system benefit problem. In this problem, we are given (i) a set ofpossible states U_(t), for each time t≧0 and (ii) a non-negative benefitfunction B whose domain is ∪_(t)(U_(t)×U_(t+1)), that denotes, for eachtime t>0, the benefit that is accrued (at time t+1) by the transitionfrom a state U_(t) to a state U_(t+1). The goal is to choose a state stfor each time t so as to maximize the total benefit$\sum\limits_{t}{{B\left( {s_{t},s_{t + 1}} \right)}.}$

[0030] In the online version of the problem with lookahead L, the states_(t)∈U_(t) should be computed based on knowing only U_(t′) for t′≦t+L,and the restriction of the function B to pairs of these sets of states.

[0031] Observe that the Web server farm problem can be cast in thissetting by identifying each possible allocation of servers to sites attime t with a state S_(i,t) and defining the benefit functionB(S_(i, t), S_(j, t+1)) to be the benefit gained by changing theallocation at time t from the one represented by S_(i,t) to theallocation at time t+1 represented by S_(j, t+)1, (In a sense, the setof states for all times is the same.) The number of states isexponential in the number of servers k, so the states and the benefitfunctions are implicit and follow from the more succinct representationof the Web server farm problem. For example, the values B(s_(i, t),s_(j, t+1)) are not listed explicitly, and any single value can beefficiently computed when necessary.

[0032] Benefit maximization variants of well known problems can also becast in this setting of a benefit task system. Consider the benefitversion of the k-server problem with one difference. Instead ofminimizing the cost of satisfying all requests, we define for each timet and any possible pair of server configurations, one at time t−1 andone at time t, a net benefit gained by satisfying the request startingfrom the configuration at time t−1 and ending at the configuration attime t. (Note that configuration at time t must include at least oneserver at the point of the request.) This benefit has to be non-negativeand is composed of a fixed positive component that is reduced by thecost to move from the configuration at time t−1 to the configuration attime t. The goal in this case is to maximize the total benefit. It isnot difficult to see that this problem can also be modeled by thebenefit task system defined above and thus all our results apply to thebenefit version of the k-server problem.

[0033] Similarly, consider the benefit version of a metrical tasksystem. This version is similar to the classical metrical task system(see, for example, A. Borodin, N. Linial and M. E. Saks, “An optimalon-line algorithm for metrical task system”, J. ACM, 39 (1992), pp.745-763), with the difference that each task is associated with a vectorof benefits, one for each state, such that the net benefit aftersubtracting the transition cost is non-negative. This model as well canbe cast as a benefit task system and our results apply.

Deterministic Online Algorithms for Benefit Task Systems

[0034] Here, we describe two deterministic algorithms for benefit tasksystems with lookahead L. The first algorithm is a future discountingalgorithm that achieves a competitive ratio of$\left( {1 + \frac{1}{L}} \right){\sqrt[L]{L + 1}.}$

[0035] Asymptotically in L, this ratio is$1 + {\frac{\Theta \left( {\log \quad L} \right)}{L}.}$

[0036] The second algorithm is an intermittent reset algorithm thatachieves a competitive ratio of${1 + \frac{4}{\left( {L - 7} \right)}},$

[0037] which is better than the first algorithm when L is sufficientlylarge.

[0038] The Future Discounting Algorithm

[0039] This is a deterministic algorithm for the benefit task systemproblem that achieves competitive ratio$\left( {1 + \frac{1}{L}} \right){\sqrt[L]{L + 1}.}$

[0040] The algorithm is based on discounting future benefits in anexponential way. Consider a strategy that collects L+1 benefits b₀, b₁,. . . , b_(L) (in this order) in the next L+1 time steps, we define itsanticipated benefit to be b₀+b₁/α+ . . . +b_(L)/α_(L) (for a parameterα>1 that we later choose as α=^(L){square root}{square root over(L+1)}).

[0041] The discounting algorithm greedily follows at each time step thestrategy with the maximum anticipated benefit. That is, at every timestep the algorithm finds a strategy for the next L+1 time steps whoseanticipated benefit is maximal and acts (in this time step) according tothis strategy. We stress that such a calculation is made every timestep, so the strategy chosen in the current time step does not have toagree with the one chosen in the previous time step.

[0042] We note that this algorithm requires that a strategy with thegreatest anticipated benefit can be computed efficiently. The followinglemma provides this requirement when the input describes the statesexplicitly. Note that we cannot apply this lemma to the Web server farmproblem since here the states are implicit and of exponential size, sowe use the offline algorithm described in copending patent applicationSer. No. 09/______ (IBM Docket YOR9-2000-0824US 1).

[0043] Lemma 1. A strategy with the largest anticipated benefit can becomputed in time that is polynomial in the number of states.

[0044] Proof. Use dynamic programming that goes interactively over thetime steps and accumulate discounted benefits. As the additional benefitof the next time step depends only on the current state, it suffices tohave a table of size proportional to the number of states.

[0045] Theorem 2. The above discounting algorithm has competitive ratioat most $\left( {1 + \frac{1}{L}} \right){\sqrt[L]{L + 1}.}$

[0046] Proof. Consider the online algorithm at time t, and denote by b₀,b₁, . . . ,b_(L) the sequence of benefits in the strategy with thelargest anticipated benefit over all strategies that the onlinealgorithm has at time t. Define ON_(t)=b₀ and ON_(t+1) ^(≠L)=b₁/α+ . .. + b_(L)/α^(L), then ON_(t)+ON_(t+1) ^(≠L) is the largest anticipatedbenefit over all the strategies that are available to the onlinealgorithm at time t. Since the online algorithm follows this strategy attime t, ON, is the benefit that the online collects for this time step.

[0047] Fixing an offline algorithm arbitrarily, let OFF, denote thebenefit that this offline algorithm collects at time t, and let OFF_(t)be a shorthand for OFF_(t)+1/α+ . . . +OFF_(t+L)/α^(L).

[0048] One strategy that is considered by the online algorithm at time tis to first join the offline algorithm (i.e., move to the location ofthe offline at time t+1), and then follow the offline algorithm for thenext L steps. The anticipated benefit of this strategy is at leastOFF_(t) ^(L). Since the online algorithm follows at each time step thestrategy with the maximum anticipated benefit, we get that

ON _(t) +ON _(t+1) ^(≠L) ≧OFF _(t+1) ^(L)  (1)

[0049] Another strategy that is considered by the online algorithm attime t is to follow the strategy that had the largest anticipatedbenefit at the previous time t−1. (Since the first step of that strategyhas already taken at time t−1, we need to add an arbitrary move at theend.) The contribution of these benefits to the anticipated benefit attime t is larger by a factor of α than their contribution at time t−1,and so the anticipated benefit of this strategy is at least αON_(t)^(≠L). Since the online algorithm follows at each time step the strategywith the maximum anticipated benefit, we get that

ON _(t) +ON _(t+1) ^(≠L) ≧αON _(t) ^(≠L)  (2)

[0050] Adding $\left( {1 - \frac{1}{\alpha}} \right)$

[0051] times inequality (1) and $\frac{1}{\alpha}$

[0052] times inequality (2), we get that $\begin{matrix}{{{ON}_{t} + {ON}_{t + 1}^{\neq L}} \geq {{ON}_{t}^{\neq L} + {\left( {1 - \frac{1}{\alpha}} \right){OFF}_{t + 1}^{L}}}} & (3)\end{matrix}$

[0053] Adding up inequality (3) over all time steps t (and assuming thatthe demands table starts and ends with L time units of zero demand), weget that${{\sum\limits_{t}{ON}_{t}} \geq {\left( {1 - \frac{1}{\alpha}} \right){\sum\limits_{t}{OFF}_{t + 1}^{L}}}} = {\left( {1 - \frac{1}{\alpha}} \right)\left( {\frac{1}{\alpha} + \quad \ldots \quad + \frac{1}{\alpha^{L}}} \right){\sum\limits_{i}{{OFF}_{t}.}}}$

[0054] The last equality follows since every benefit that the offlinecollects is accumulated with each of the discounts 1/α, . . . , 1/α^(L).We conclude that the competitive ratio of the algorithm is (choosingα=^(L){square root}{square root over (L+1)}):${\frac{\sum\limits_{i}{OFF}_{t}}{\sum\limits_{t}{ON}_{t}} \leq \frac{\frac{\alpha}{\alpha - 1}}{\frac{\alpha^{L} - 1}{\alpha^{L}\left( {\alpha - 1} \right)}}} = {\frac{\alpha^{L + 1}}{\alpha^{L - 1}} = {\frac{\left( {L + 1} \right)^{\frac{({L + 1})}{L}}}{L} = {\left( {1 + \frac{1}{L}} \right){\sqrt[L]{L + 1}.}}}}$

[0055] An Intermittent Reset Algorithm

[0056] This is a deterministic intermittent reset online algorithm thathas competitive ratio $1 + {O\left( \frac{1}{L} \right)}$

[0057] for the benefit task system problem. This algorithm is motivatedby the randomized algorithm described below that wastes one of every L+1steps in order to gain the optimal benefit between wasted steps. Here,we waste one in every Θ(L) steps, but the choice of steps to waste isdone carefully in a deterministic fashion and the overall benefit thatwe gain is close to that of the randomized algorithm.

[0058] The algorithm works in iterations each of length at least L/2.Let s_(i) denote the start time of iteration i. Each iteration iconsists of four steps as follows:

[0059] STEP 1: Consider all times t=s_(i)+L/2+1 . . . ,s_(i)+L. For eachsuch time t, let x_(t) denote the maximum benefit of any transition froma state at time t to a state at time t+I. Let T be the time t thatminimizes x_(t), i.e., x_(T)=min{x_(t):s_(t)+L/2+1≦t≦s_(i)+L}.

[0060] STEP 2: Compute the optimal sequence of transitions that startsat any state at time s_(i)+1 and ends at any state at time T. This canbe done either by dynamic programming similar to Lemma 2 or by applyingthe offline algorithm above. (We remark that in the first iteration, theinitial state is given and thus we may compute the optimal sequence oftransitions from the initial state to any state at time T. The next stephas to be modified accordingly.)

[0061] STEP 3: Move from the current state at time s_(i) to the state attime s_(i)+1 that is the starting state of the optimal sequence computedabove, and continue with the optimal sequence of moves to the state attime T.

[0062] STEP 4: Set the starting point s_(i+1)=T for the next iteration.

[0063] Theorem 3. The above intermittent reset algorithm has competitiveratio at most $1 + {\frac{4}{L - 7}.}$

[0064] Proof We assume L is a multiple of 4, and otherwise round down tothe nearest multiple of 4 (in the expense of-increasing the competitiveratio as explained later). We will call the starting times of theiterations “gaps”. Denote the gaps by s₁, S₂, . . . We divide thetransitions taken by the algorithm into two components, the moves takenin the gaps and the steps taken in the rest of the times. Consider thepath taken by the online algorithm. It may not collect any benefit inthe gaps, but since it computes the optimal paths between gaps (allowingarbitrary initial and terminal states adjacent to the gaps), clearly thebenefit of the optimal offline between gaps is bounded by the benefit ofthe online algorithm between gaps.

[0065] Now we bound the benefit of the optimal algorithm in the gaps.Consider iteration i starting at si and computing T=s_(i)+1. Considerthe portion of the online path from s_(i)+L/2+1 to si+1. Denote thelength of this portion by a, i.e., a=s_(i+1)−(s_(i)+L/2+1). Consider theportion of the path computed in the next iteration from s_(i+1)+1 tos_(i)+L+1. Denote the length of this portion by b, i.e.,b=s_(i)+L+1−(s_(i+1)+1). By our choice of L, L/2 is even and a+b=L/2−1.Thus, one of a and b is even and the other is odd. Assume a is odd and bis even; the proof is similar in the opposite case. (We note thatideally, we would like both a and b to be even, but choosing a+b to beeven may lead to a worse case when both are odd.)

[0066] We claim that the benefit achieved by the online algorithm inthese portions of the path at least x_(T)·(a+b−1)/2. This is true sincein every time step in the range there is a transition of benefit x_(T)and thus the online algorithm can achieve benefit at least x_(T) onevery other transition, even if it collects no benefit on the other halfof the transitions. Since a is odd, it can collect at leastx_(T)·(a−1)/2 in the first portion, and since b is even, it can collectat least x_(T)·b2 in the second.

[0067] Putting these together along with a+b=L/2−1, we have that theonline benefit is at least${x_{T} \cdot \left( {\frac{a - 1}{2} + \frac{b}{2}} \right)} = {x_{T} \cdot {\frac{L - 4}{4}.}}$

[0068] Since s_(i)+L+1 is always less than s_(i+1)+L/2+1, these portionsare disjoint among iterations. Summing over all iterations, we have${{{ON} \cdot \left( \frac{4}{L - 4} \right)} \geq {\sum\limits_{i}x_{T_{1}}}},$

[0069] where ON denotes the total benefit collected by the onlinealgorithm and x_(T) _(i) denotes the maximum benefit possible in thei'th gap. Accounting for the portions outside the gaps, we have${{ON} \geq {{OFF} - {\sum\limits_{i}x_{T_{i}}}}},$

[0070] where OFF denotes the optimal offline benefit. Putting thesetogether and allowing for values of L that are not multiples of 4 yieldsthe desired bound of $1 + {\frac{4}{L - 7}.}$

Special Cases of the Server Allocation Problem

[0071] We devise a deterministic online algorithm for the Web serverfarm problem with one server, two sites and lookahead L=1.

[0072] One server and Two Sites with Lookahead One

[0073] We devise a deterministic online algorithm for the Web serverfarm problem with one server, two sites and lookahead L=1. The algorithmhas competitive ratio T=1+φ, where$\varphi = {\frac{1 + \sqrt{5}}{2} \approx 1.618}$

[0074] is the golden ratio. This ratio is nearly the best possible inthis case, as we present a lower bound of$\frac{3\sqrt{3}}{2} \approx 2.598$

[0075] on the competitive ratio of any deterministic algorithm for thisproblem. We remark that the competitive ratio that we obtain in thiscase is much better than in the case of arbitrary number of sites, wherethe best possible competitive ratio is 4.

[0076] The algorithm is based on discounting future benefits. It issimilar to the future discounting algorithm presented above (specializedto the case L=1) with the exception that the discount factor is taken tobe φ. The analysis for this case adds some complication to that of thegeneral case, in order to take advantage of the limited number of sites.For example, a discount factor of 2 optimizes the analysis of thesection relating to the future discounting algorithm, and then thecompetitive ratio is shown to be at most 4. The actual competitive ratioin this case is 3, which can be shown by an analysis similar to the onethat we give here.

[0077] The following theorem states the improved competitive ratio forthis case.

[0078] Theorem 4. The discounting algorithm with discount factor φachieves competitive ratio r=1+φ˜2.618 for the web server farm problemwith one server and two sites.

[0079] Proof. Let us first describe the algorithm in more detail. Weassociate with each possible allocation its anticipated benefit, whichcombines the immediate benefit of this allocation and its futurebenefit. To compensate for the uncertainty of a future benefit (thealgorithm might later decide to not collect these benefits), we discountit (with respect to an immediate benefit) by a factor of φ. In otherwords, an action that causes the algorithm to collect a benefit b and tohave the potential to collect in the future a benefit b′ has anticipatedbenefit of φ·b+b′.

[0080] Suppose that the situation of the online algorithm at some time tis as described below. Assume, without loss of generality, theallocation of the server in the previous time unit is to the first site,as denoted by a triangle. Since the lookahead is L=1, the algorithmknows only the demands in the current time and in the next t+1.$d_{i,t} = \begin{bmatrix}\ldots & {\vartriangleright x} & x^{\prime} & ? & ? & \ldots \\\ldots & y & y^{\prime} & ? & ? & \ldots\end{bmatrix}$

[0081] The algorithm decides on the allocation of the server at time tas follows. If φ·x+x′≧y, then the previous allocation is kept, i.e., theonline algorithm allocates the server at time t to the first site.Otherwise the algorithm changes the allocation and the server isallocated to the second site. Observe that this decision matches thelargest anticipated benefit for the algorithm. If it decides to staywith the allocation as before, it collects a benefit of x and will havethe option to collect at next time t+1 an additional benefit x′,yielding an anticipated benefit φ·x+x′. If the algorithm decides tochange the allocation to the other site, then it collects no immediatebenefit (at this point there is no way for the online algorithm tocollect the benefit y), and in the next time t+1 it will have the optionto collect a benefit y′, yielding an anticipated benefit φ·0+y′=y′.

[0082] We will prove by induction on T that${{r{\sum\limits_{t \leq T}{ON}_{t}}} + {q_{T + 1} \cdot {ON}_{T + 1}^{*}}} \geq {{\sum\limits_{t \leq T}{OFF}_{t}} + {OFF}_{T + 1}^{*}}$

[0083] where ON_(t) is the actual benefit collected at time t by theonline algorithm; ON_(t) ^(*) is the potential benefit that the onlinealgorithm will collect at time t if it remains allocated to the samesite as in time t−1; OFF_(t), OFF_(t) ^(*) are defined similarly for anarbitrary offline algorithm; and q_(t)=φ if at time t−1 the online andthe offline solutions have the same allocation (i.e., if they have thesame “starting position” for time t), and q_(t)=1 otherwise. (Note thatON_(t) is either ON_(t) ^(*) in case the potential benefit is gained or0.) In a sense, this is a potential function analysis; see for exampleA. Borodin and R. El-Yaniv, On-line Computation and CompetitiveAnalysis, Cambridge University Press (1998).

[0084] Proving Equation (4) would complete the proof, since we canassume that the demands matrix is padded with zeros from both sides, andobtain for the last time T that${{r{\sum\limits_{t}{ON}_{t}}} \geq {\sum\limits_{i}{OFF}_{t}}},$

[0085] as required.

[0086] The base case of the induction follows from padding the demandsmatrix with zeros from both sides. For the inductive step, i.e., thatthe induction hypothesis (4) for time T follows from that of time T−1,it suffices to show that

r·ON _(T) +q _(T+1) ·ON _(T+1) ^(*) −q _(T) ·ON _(T) ^(*) ≧OFF _(T) +OFF_(T+1) ^(*) −OFF _(T) ^(*)  (5)

[0087] We prove inequality (5) by verifying it over all cases. Denotethe benefits at times T, T+1 by x, x′, y, y′ as above. Assume withoutloss of generality that at time T−1 the server is allocated to the firstsite. The total number of cases is eight since there are two possibledecisions for the online, and four possible decisions for the offline.

[0088] Consider first the cases in which the allocation of the offlineat times T and T+1 are the same. Then at time T the offline collects thebenefit OFF_(t) ^(*), and hence OFF_(t)=OFF_(t) ^(*). In addition ON_(t)^(*)=x, so inequality (5) simplifies to

r·tON _(T) +q _(T+1) ON _(T+1) ^(*) −q _(T) ·x ≧OFF _(T+1) ^(*)

[0089] 1.q_(T)=φ, q_(T+1)=φ. Then both offline and online collect x. Weneed to show that

r·x+φ·x′−φ·x≧x′

[0090]  i.e., that x+(φ−1)x′>0 which clearly holds. ✓

[0091] 2. q_(T)=1, q_(T+1)=1. Then offline collects y and onlinecollects x. We need to show that

r·x+x′−x≧y′

[0092]  i.e., that φ·x′≧y′, which holds since online keeps the previousallocation. ✓

[0093] 3. q_(T)=φ, q_(T+1)=1. Then offline collects x and online doesnot collect x. We need to show that

r·0+y′−φ·x≧x′

[0094]  which holds since online changes allocation. ✓

[0095] 4. q_(T)=1, q_(T+1)=φ. Then offline collects y and online doesnot collect x. We need to show that

r·0+φ·y′−x≧y′

[0096]  i.e., that y′≧1/(φ−1)·x=φ·x which holds since online changesallocation. ✓

[0097] Consider now the cases in which the allocation of the offline attimes T and T+1 are different. Then the benefit of the offline at time Tis OFF_(T)=0. In addition ON_(T) ^(*)=x, so inequality (5) simplifies to

r·ON _(T) q _(T+1) ON _(T+1) ^(*) −q _(T) ·x≧OFF _(T+1) ^(*) −OFF;

[0098] 5. q_(T)=φ, q_(T+1)=φ. Then offline and online both do notcollect x. We need to show that

r·0+φ·y′−φ·x≧y′−x

[0099]  i.e., that y′≧x, which clearly holds since online changesallocation. ✓

[0100] 6. q_(T)=1, q_(T+1)=1. Then offline does not collect y and onlinedoes not collect x. We need to show that

r·0+y′−x≧x′−y

[0101]  and since online changes allocation we indeed gety′≧φx+x′≧x+x′−y. ✓

[0102] 7. q_(T)=φ, q_(T+1)=1. Then offline does not collect x and onlinecollects x. We need to show that

r·x+x′−φ·x≧y′−x

[0103]  i.e. that 2x+x′≧y′ which holds since online keeps the previousallocation. ✓

[0104] 8. q_(T)=1, q_(T+1)=φ. Then offline does not collect y and onlinecollects x. We need to show that

r·x+φ·x′−x≧x′−y

[0105]  i.e. that φ·x+(φ−1)x′+y≧0 which clearly holds. ✓

[0106] Multiple Servers with Lookahead One

[0107] We present an online algorithm for the web server farm problemwith multiple servers and lookahead one.

[0108] For the case of an even k, we describe below the algorithm andits analysis. In the case of an odd k>3, the algorithm is more involved.We remark that it applies the algorithm below (for an even number ofservers) on the “first” k−1 servers, and yet another algorithm for theadditional server.

[0109] For an even k, the algorithm splits the set of servers into twosets of equal size. The first set of servers is allocated so as toalways collect the k/2 biggest benefits (demands) on the odd time steps.These servers spend the even time steps in reallocation to those siteswhere they will be able to collect in the following time step, which isodd, the k/2 biggest benefits. On even time steps, these servers maycollect zero benefit in the worst case. The second set of servers isscheduled in a symmetric way. It collects the k/2 biggest benefits onthe even time steps and spend the odd time steps on reallocation to thebest sites for the following time step which is even. We conclude thatat each time t, the total benefit that the k servers collect is at leastas large as the k/2 biggest benefits at this time t, which is clearly atleast half the benefit that an optimal offline algorithm can collect atthis time t. Therefore, the competitive ratio of this algorithm is atmost 2.

[0110] Theorem 5. There is a deterministic algorithm for the web serverfarm problem that achieves competitive ratio 2 when the number ofservers k is even, and competitive ratio c_(k)=2+2/(2k−1) when k≧3 isodd.

[0111] Proof. The case of an even k was already shown above. We thusdeal below with the case that k is odd.

[0112] For an odd k, the algorithm splits the servers into three groups.Two groups are of size (k−1)/2 each, and the third group contains oneserver. The first group of servers collects the (k−1)/2 biggest benefitson the odd time steps. The second group collects the (k−1)/2 biggestbenefits on the even time steps. Let F_(t) denote the (k+1)/2 biggestbenefit on step t. The last server tries to collect F_(t) on each timestep, as follows. On the step t the server either collects F_(t) or itmoves to the web site q such that d_(q, t+1)=F_(t+1). The servercollects F_(t) if 2F_(t)>F_(t+1); otherwise, the server moves to the website q. If the server collects F_(t) on some step t, it wastes the stept+1 on a move to the (k+1)/2′th best web site q for the step t+2, i.e.,d_(q, t+2)=F_(t+2).

[0113] For the sake of analysis we split time into phases: the firstphase starts at the time step 0 (by convention we assume that benefitsat this time step are equal to zero), phase ends at the time step t+1 ifthe server from the third group collects Ft on step t, the next phasestarts at step t+2 and so on. Notice that the server from the thirdgroup always starts the phase allocated at the (k+1)/2′th best web site.Consider the first phase. We claim that$F_{t} \geq {\frac{1}{4}{\sum\limits_{i = 1}^{t + 1}{F_{i}.}}}$

[0114] Indeed, 2F_(i)≦F_(i+1) for i=1, . . . , t−1 and 2F_(t)>F_(t+1);therefore,${{\sum\limits_{i = 1}^{t + 1}F_{i}} < {F_{t}{\sum\limits_{i = 1}^{t + 1}\frac{1}{2^{t - i}}}} \leq {2F_{t}{\sum\limits_{j = 0}^{\infty}\frac{1}{2^{j}}}}} = {4{F_{t}.}}$

[0115] For p≦k, if S(τ, p) is a sum of p best benefits on step τ, then${\sum\limits_{\tau}{S\left( {\tau,p} \right)}} \geq {\frac{p}{k}{\sum\limits_{\tau}{OFF}_{\tau}}}$

[0116] and${{\sum\limits_{\tau = 1}^{t + 1}{ON}_{\tau}} \geq {{\sum\limits_{\tau = 1}^{t + 1}{S\left( {\tau,\frac{\left( {k - 1} \right)}{2}} \right)}} + F_{t}} \geq {{\frac{3}{4}{\sum\limits_{\tau = 1}^{t + 1}{S\left( {\tau,\frac{\left( {k - 1} \right)}{2}} \right)}}} + {\frac{1}{4}{\sum\limits_{\tau = 1}^{t + 1}{S\left( {\tau,\frac{\left( {k + 1} \right)}{2}} \right)}}}} \geq {\left( {\frac{3\left( {k - 1} \right)}{8k} + \frac{\left( {k + 1} \right)}{8k}} \right){\sum\limits_{\tau = 1}^{t + 1}{OFF}_{\tau}}}} = {{\frac{{2k} - 1}{4k}{OFF}} = {c_{k}^{- 1}{{OFF}.}}}$

[0117] The same proof works for any phase and therefore we proved thatour algorithm is c_(k)-competitive for odd k≧3.

[0118] Randomized Online Algorithms

[0119] In this section we derive tight bounds on the competitive ratioof randomized online algorithms with lookahead L. These bounds arestated in the following theorem We remark that our randomized algorithmrequires only O(log L) random bits, independent of the input length.

[0120] Theorem 6. There is a randomized online algorithm withcompetitive ratio 1+1/L. Furthermore, no randomized algorithm achieves alower competitive ratio.

[0121] Proof. The idea behind the algorithm is that with lookahead L, wecan compute an optimal path for L time steps. However, we may have tomake a poor move, in which we collect little or no benefit, in order toreach the first state on this path. After following this path, we canagain choose the best state to move to during the next time step,possibly without collecting any benefit at all, but ensuring the beststarting point for the next L steps. We lose only a 1/(L+1) fraction ofthe available benefit over each L+1 time steps. We refer to this as the“resetting” algorithm, since it operates in stages, after each of whichit resets to an optimal state for the upcoming stage. The onlinealgorithm will collect at least as much benefit as the optimal offlinealgorithm on every step except the resetting steps. Notice that thereare L+1 possible “phases”, i.e., phase j means (potentially) giving upall benefit during steps i·(L+1)+j for each i, where 0≦j≦L. Randomizingover these choices, the online algorithm loses in expectation only a1/(L+1) fraction of the offline benefit, and the competitive ratio is atmost$\frac{1}{1 - \frac{1}{\left( {L + 1} \right)}} = {1 + {\frac{1}{L}.}}$

[0122] For any ∈>0, we demonstrate a lower bound of (L+1)/(L+G) for theone-server problem. Our randomized adversary generates a demand matrixdi,t with ┌1/∈┐ rows and L+2 columns (which can be repeatedindefinitely), and a revenue matrix of all ones. The first column of thedemand matrix contains all zeroes, the next L columns contain all ones,and exactly one randomly chosen row in the last column contains a oneand the rest contain zeroes. The optimal choice is for the server tomove during the first step to the row containing the one in column L+2,and to stay in that row for L+1 steps, collecting a total benefit ofL+1. Any randomized online strategy stands only an ∈ chance of choosingthis row, and with probability at least 1−∈ must either miss the benefitin this column, or forgo benefit in some earlier column in order tocollect it. Thus, the expected benefit collected by the randomizedonline algorithm is at most L+∈.

[0123] Returning now to the drawings, the computation of new allocations(function block 23 in FIG. 2) is shown in FIG. 3. The process beginswith an initialization step in function block 31 where t is set to thecurrent time. In function block 32, the discounted revenues D(c, t+i)are computed for each customer c and each time period from current timet through current time plus lookahead t+L, using actual revenues R(c,t+i) and discount factor alpha:${D\left( {c,{t + i}} \right)} = \frac{R\left( {c,{t + i}} \right)}{\alpha}$

[0124] Based on this computation, the optimal allocations from thecurrent time through current time plus lookahead are found, startingfrom the current allocation, in function block 33. Finally, in functionblock 34, allocations and transitions in allocations for the next timeperiod from t to t+1 are returned.

[0125] While the invention has been described in terms of a preferredembodiment, those skilled in the art will recognize that the inventioncan be practiced with modification within the scope of the appendedclaims.

Having thus described our invention, what we claim as new and desire tosecure by Letters Patent is as follows:
 1. A method of resourceallocation to yield a benefit comprising the steps of: associating eachcustomer's demand with a benefit gained; and finding a time-varyingresource allocation that would yield a benefit.
 2. The method ofresource allocation as recited in claim 1, further comprising the stepsof: discounting future benefits; and finding optimal allocations ofresources from current time through current time plus lookahead based ondiscounted benefit and forecast demand, wherein the step of discountingfuture benefits is based on a future discounting algorithm.
 3. Themethod of resource allocation recited in claim 2, wherein the futurediscounting algorithm is based on a policy which, when faced with achoice between a guaranteed benefit immediately and a potential benefitin the future, a decision is made by comparing the guaranteed benefitvalue with a discounted value of the potential future benefit.
 4. Themethod of resource allocation recited in claim 2, wherein the futurediscounting algorithm is a deterministic algorithm that achieves acompetitive ratio of${\left( {1 + \frac{1}{L}} \right)\sqrt[L]{L + 1}},$

where L is a lookahead factor which models some amount of future demandknown to a provider of the resource.
 5. The method of resourceallocation recited in claim 2, wherein the algorithm is an intermittentreset algorithm that achieves a competitive ratio of${1 + \frac{4}{\left( {L - 7} \right)}},$

where L is a lookahead factor which models some amount of (L-7) futuredemand known to a provider of the resource.
 6. The method of resourceallocation as recited in claim 1, wherein resource allocation is done tomaximize a benefit.
 7. The method of resource allocation as recited inclaim 1, wherein the benefit is a tangible benefit.
 8. The method ofresource allocation as recited in claim 7, wherein the tangible benefitis a profit and resource allocation is done to maximize the profit. 9.The method of resource allocation as recited in claim 1, wherein thebenefit is an intangible benefit.
 10. The method of resource allocationas recited in claim 9, wherein the intangible benefit is customersatisfaction and resource allocation is done to maximize customersatisfaction.
 11. The method of resource allocation as recited in claim1, wherein the resource is computer cycles and resource allocation isdone to more efficiently solve computationally intensive problems.
 12. Amethod of resource allocation to yield a benefit comprising the stepsof: modeling the resource allocation problem mathematically; in themodel, dividing time into intervals of fixed length based on theassumption that demand is uniformly spread throughout each suchinterval; and associating each customer's demand with a benefit gainedand finding a time-varying resource allocation that would maximizebenefit gained.
 13. The method of resource allocation as recited inclaim 12, further comprising the steps of: discounting future benefits;and finding optimal allocations of resources from current time throughcurrent time plus lookahead based on discounted benefit and forecastdemand, wherein the step of discounting future benefits is based on afuture discounting algorithm.
 14. The method of resource allocationrecited in claim 13, wherein the future discounting algorithm is basedon a policy which, when faced with a choice between a guaranteed benefitimmediately and a potential benefit in the future, a decision is made bycomparing the guaranteed benefit value with a discounted value of thepotential future benefit.
 15. The method of resource allocation recitedin claim 13, wherein the future discounting algorithm is a deterministicalgorithm that achieves a competitive ratio of${\left( {1 + \frac{1}{L}} \right)\sqrt[L]{L + 1}},$

where L is a lookahead factor which models some amount of future demandknown to a provider of the resource.
 16. The method of resourceallocation recited in claim 12, wherein the future discounting algorithmis an intermittent reset algorithm that achieves a competitive ratio of${1 + \frac{4}{\left( {L - 7} \right)}},$

where L is a lookahead factor which models some amount of future demandknown to a provider of the resource.
 17. The method of resourceallocation as recited in claim 12, wherein the benefit is a tangiblebenefit.
 18. The method of resource allocation as recited in claim 17,wherein the tangible benefit is a profit and resource allocation is doneto maximize the profit.
 19. The method of resource allocation as recitedin claim 12, wherein the benefit is an intangible benefit.
 20. Themethod of resource allocation as recited in claim 19, wherein theintangible benefit is customer satisfaction and resource allocation isdone to maximize customer satisfaction.
 21. The method of resourceallocation as recited in claim 12, wherein the resource is computercycles and resource allocation is done to more efficiently solvecomputationally intensive problems.
 22. A method for server allocationin a Web server “farm” based on limited information regarding futureloads to achieve close to greatest possible revenue based on anassumption that revenue is proportional to the utilization of serversand differentiated by customer class comprising the steps of: modelingthe server allocation problem mathematically; in the model, dividingtime into intervals of fixed length based on the assumption that eachsite's demand is uniformly spread throughout each such interval;maintaining server allocations fixed for the duration of an interval,servers being reallocated only at the beginning of an interval, and areallocated server being unavailable for the length of the intervalduring which it is reallocated providing time to “scrub” the old site(customer data) to which the server was allocated, to reboot the serverand to load the new site to which the server has been allocated, eachserver having a rate of requests it can serve in a time interval andcustomers share servers only in the sense of using the same servers atdifferent times, but do not use the same servers at the same time; andassociating each customer's demand with a benefit gained by the serviceprovider in case a unit demand is satisfied and finding a time-varyingserver allocation that would maximize benefit gained by satisfyingsites' demand.
 23. The method for server allocation in a Web server“farm” as recited in claim 22, further comprising the steps of:discounting future benefits; and finding optimal allocations of serversfrom current time through current time plus lookahead based ondiscounted revenues and forecast demand, wherein the step of discountingfuture benefits is based on a future discounting algorithm.
 24. Themethod for server allocation in a Web server “farm” as recited in claim23, wherein the future discounting algorithm is based on a policy which,when faced with a choice between a guaranteed benefit immediately and apotential benefit in the future, a decision is made by comparing theguaranteed benefit value with a discounted value of the potential futurebenefit.
 25. The method for server allocation in a Web server “farm” asrecited in claim 22, wherein the future discounting algorithm is adeterministic algorithm that achieves a competitive ratio of${\left( {1 + \frac{1}{L}} \right)\sqrt[L]{L + 1}},$

where L is a lookahead factor which models some amount of future demandknown to a provider of the resource.
 26. The method for serverallocation in a Web server “farm” as recited in claim 22, wherein thefuture discounting algorithm is an intermittent reset algorithm thatachieves a competitive ratio of${1 + \frac{4}{\left( {L - 7} \right)}},$

where L is a lookahead factor which models some amount of future demandknown to a provider of the resource.
 27. The method for serverallocation in a Web server “farm” as recited in claim 23, whereinresource allocation is done to maximize profit.